package com.power.sifa.account.controller;

import com.plf.common.domain.ResponseDTO;
import com.power.sifa.account.api.IHa_user_approveFeign;
import com.power.sifa.account.model.pageInfo.Ha_user_approvePageInfo;
import com.power.sifa.account.service.Ha_user_approveService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
public class Ha_user_approveController implements IHa_user_approveFeign {

    @Resource
    Ha_user_approveService ha_user_approveService;

    @Override
    public ResponseDTO findUserTree(String departid, Ha_user_approvePageInfo pageInfo) {
        try {
            return ResponseDTO.succData(this.ha_user_approveService.findUserTree(departid, pageInfo));
        } catch (Exception e) {
            e.printStackTrace();
            log.error("/approve/ha_user/findUserTree 查询部门或单位用户树失败 ->  msg[{}]", e.getMessage());
            return ResponseDTO.wrap(500, "查询部门或单位用户树失败");
        }

    }
}
